<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html>
<head>
	<meta charset="UTF-8">
	<title>京东(JD.COM)-综合网购首选-正品低价、品质保障、配送及时、轻松购物！</title>
	<link rel="stylesheet" href="/tpshop/Public/css/bootstrap.min.css">
	<link rel="stylesheet" href="/tpshop/Public/css/bootstrap-theme.min.css">
	<link rel="stylesheet" href="/tpshop/Public/css/front.css">
	<link rel="stylesheet" href="/tpshop/Public/css/nivo-slider.css">
	
</head>
<body>
	<div class="container">
		<div class="row" id="header" >
	<div class="col-md-3">
		<a href="/tpshop/index.php"><img id="logo" src="/tpshop/Public/img/logo.png" /></a>
	</div>
	<div class="col-md-6">
		<p id="contact"><i class="glyphicon glyphicon-phone-alt"></i>400-12345678910<i class="glyphicon glyphicon-envelope"></i>onlyallure@163.com</p>
		<div class="input-group">
			<input type="text" class="form-control" placeholder="请输入商品名称或店铺...">
			<span class="input-group-btn">
				<button class="btn btn-danger" type="button">搜索</button>
			</span>
		</div>
	</div>
	<div class="col-md-3">
		<div class="login_info">
			<?php if($_SESSION['user_is_login']){?>
				<span>欢迎回来,<?=$_SESSION['username']?></span><a href="<?=U('user/logout')?>">退出</a>
				<?php }else{?>
					<a href="<?=U("user/login")?>">立即登录</a>
					<a href="<?=U('user/regedit')?>">立即注册</a>
				<?php }?>
		</div>
		<a href="<?=U('shopping/cartlist')?>" id="shopcart" class="pull-right">
		
			<i class="glyphicon glyphicon-shopping-cart"></i>我的购物车
			
			<?php if($_SESSION['user_is_login']){?>
			<span><?=M('user_cart')->where('user_id ='.$_SESSION['user_id'])->count()?></span>
			<?php }?>
		</a> 
	</div>
</div>
		<br /><br />
		<div class="row">
			<div class="col-md-3" id="menu">
				<div id="menu_title"><a href="#" class="navbar-link"><i class="glyphicon glyphicon-menu-hamburger"></i>所有分类</a></div>
				<ul>
				<?php foreach($catalog as $c){?>
					<li><a href="<?=U('home/product/lists/',array('cataid'=>$c['id']))?>"><?=$c['name']?><i class="pull-right"> ></i></a></li>
					<?php }?>
				</ul>
			</div>
			<div class="col-md-9">
				<div class="slider-wrapper theme-default">
		            <div id="slider" class="nivoSlider">
		                <a href=""><img src="/tpshop/Public/upload/1.jpg"  /></a>
		                <a href=""><img src="/tpshop/Public/upload/2.jpg"  /></a>
		                <a href=""><img src="/tpshop/Public/upload/3.jpg"  /></a>
		                <a href=""><img src="/tpshop/Public/upload/4.jpg" /></a>			            
		            </div>
		        </div>
			</div>
		</div>
		<br />
		<div class="row">
			<div class="col-md-8">
				<div id="hot_sale">
					<?php foreach($products as $p){?>
					<div class="item clearfix">
						<a href="<?=U('home/product/detail/',array('id'=>$p['id']))?>"><img style="width:150px;height:150px;" src="/tpshop<?=($p['img'])?>"></a>
						<h4><a href="<?=U('home/product/detail/',array('id'=>$p['id']))?>"><?=$p['title']?></a></h4>
						<p><?=$p['desc']?></p>
						<div class="price">
								¥<?=number_format($p['price'],2)?>
							<a  style="color:#fff;"  href="<?=U('home/product/detail/',array('id'=>$p['id']))?>" class="btn btn-danger buy_now pull-right">立即抢购</a>
						</div>
					</div>
					<?php }?>
				</div>
			</div>
			<div class="col-md-4">
				<div style="background:url('http://placehold.it/293x170?text=广告位1') no-repeat;background-size:100% 100%;height:170px;width:100%;"></div>
				<div id="news">
					<ul class="nav nav-tabs nav-justified" role="tablist">
					    <li role="presentation" class="active"><a style="color:#666;" href="#notice" data-toggle="tab">公告</a></li>
					    <li role="presentation"><a style="color:#666;"  href="#new" data-toggle="tab">新闻</a></li>
					</ul>
					<div class="tab-content">
					    <div role="tabpanel" class="tab-pane active" id="notice">
					    	<ul>
					    	<?php foreach($notice as $n){?>
					    		<li><a href="#"><?=$n['title']?></a></li>
					    		<?php }?>
					    	</ul>
					    </div>
					    <div role="tabpanel" class="tab-pane" id="new">
					    	<ul>
					    	<?php foreach($new as $n){?>
					    		<li><a href="#"><?=$n['title']?></a></li>
					    		<?php }?>
					    	</ul>
					    </div>
					</div>
				</div>
			</div>
		</div>	
		<br />
		<div class="row floor">
			<div class="row">
			<?php
 $catalog_ids = array(100); $i = 1; foreach($catalog_ids as $ci){ $f_recommend = M('product')->where('cata_id ='.$ci.' and recommend = 1')->find(); $floor = M('product')->where('cata_id ='.$ci.' and recommend = 0')->limit(6)->select(); $cata = M('product_catalog')->where('id = '.$ci)->find(); ?>
				<div class="col-md-12">
					<p class="title"><span><?=$i?>F</span>&nbsp;&nbsp;<?=$cata['name']?></p>
					<div class="main clearfix">
						<div class="first clearfix">
							<img style="width:200px;height:200px;" src="/tpshop<?=$f_recommend['img']?>" />
							<h5><a href="<?=U('home/product/detail/',array('id'=>$f_recommend['id']))?>"><?=$f_recommend['title']?></a></h5>
							<div class="p"><?php echo $f_recommend['desc']?></div>
							<div class="price">
									¥<?php echo $f_recommend['price']?>
							</div>
							<a style="color:#fff;" href="<?php echo U('home/product/detail/',array('id'=>$f_recommend['id']))?>" class="btn btn-danger buy_now pull-right">立即抢购</a>
						</div>
						<?php foreach($floor as $f){?>
						<div class="item clearfix">
							<a href="<?php echo U('home/product/detail/',array('id'=>$f['id']))?>"><img style="width:100px;height:100px;" src="/tpshop<?php echo $f['img']?>" /></a>
							<div class="t"><a href="<?php echo U('home/product/detail/',array('id'=>$f['id']))?>"><?php echo $f['title']?></a></div>
							<div class="price">
									¥<?php echo $f['price']?>
							</div>
						</div>
						<?php }?>
					</div>
				</div>
				<?php
 $i++; }?>
			</div>
		</div>
		<hr style="border-color:#ccc;" />
		<div class="froot">
			<ul>
				<li><a href="">帮助中心</a></li>
				<li><a href="">购物指南</a></li>
				<li><a href="">配送方式</a></li>
				<li><a href="">支付方式</a></li>
			</ul>
			<ul>
				<li><a href="">技术支持</a></li>
				<li><a href="">售后网点</a></li>
				<li><a href="">常见问题</a></li>
			</ul>
			<ul>
				<li><a href="">关于商城</a></li>
				<li><a href="">公司介绍</a></li>
				<li><a href="">商城简介</a></li>
				<li><a href="">联系客服</a></li>
			</ul>
			<ul>
				<li><a href="">关注我们</a></li>
				<li><a href="">商城手机版</a></li>
			</ul>
			<ul>
				<li><a href="">售后服务</a></li>
				<li><a href="">保修政策</a></li>
				<li><a href="">退换货政策</a></li>
				<li><a href="">退换货流程</a></li>
			</ul>
		</div>
		<hr style="border-color:#ccc; clear: both;" />
		<p style="text-align: center;"><a href="" style="text-decoration: none; color:#666;">京公网安备 11000002000088号  |  京ICP证070359号  |  互联网药品信息服务资格证编号(京)-经营性-2014-0008  |  新出发京零 字第大120007号</a></p>
		<p style="text-align: center;"><a href="" style="text-decoration: none; color:#666;">互联网出版许可证编号新出网证(京)字150号  |  出版物经营许可证  |  网络文化经营许可证京网文[2014]2148-348号  |  违法和不良信息举报电话：4006561155</a></p>
		<p style="text-align: center; color:#666;">Copyright © 2004 - 2016  京东JD.com 版权所有  |  消费者维权热线：4006067733</p>
		<p style="text-align: center;"><a href="" style="text-decoration: none; color:#666;">京东旗下网站：京东钱包</a></p>
	</div>
	
	 <script type="text/javascript" src="/tpshop/Public/js/jquery-3.1.0.min.js"></script>
    <script type="text/javascript" src="/tpshop/Public/js/bootstrap.min.js"></script>
	<script type="text/javascript" src="/tpshop/Public/js/jquery.nivo.slider.pack.js"></script>
	<script type="text/javascript">
	    $(function(){
	        $('#slider').nivoSlider({
	        	prevText: '<i class="glyphicon glyphicon-menu-left"></i>',                 // Prev directionNav text 
				nextText: '<i class="glyphicon glyphicon-menu-right"></i>', 
	        });
	    });
    </script>
</body>
</html>